#ifndef TOOLMANAGER_H_
#define TOOLMANAGER_H_

#include "Vector2D.h"
#include "Camera.h"
#include "Border.h"
#include "Tool.h"
#include "ClosedObject.h"
#include "ObjectList.h"
#include "MenuManager.h"
#include "TextureManager.h"
#include "TextBox.h"
#include "MaterialList.h"

class ToolManager
{
	bool leftClickDepressed;
	bool leftClickWasDepressed;
	bool rightClickDepressed;
	bool rightClickWasDepressed;
	bool saveKeyDepressed;
	bool saveKeyWasDepressed;
	bool zoomInKeyDepressed;
	bool zoomInKeyWasDepressed;
	bool zoomOutKeyDepressed;
	bool zoomOutKeyWasDepressed;
	
	bool toolCycleKeyDepressed;
	bool toolCycleKeyWasDepressed;
	bool toolBackwardCycleKeyDepressed;
	bool toolBackwardCycleKeyWasDepressed;
	bool toolNextModeKeyDepressed;
	bool toolNextModeKeyWasDepressed;
	bool toolLastModeKeyDepressed;
	bool toolLastModeKeyWasDepressed;
	bool toolNextParameterKeyDepressed;
	bool toolNextParameterKeyWasDepressed;
	bool toolLastParameterKeyDepressed;
	bool toolLastParameterKeyWasDepressed;
	
	TextBox * currentToolText;
	TextBox * currentModeText;
	TextBox * currentParameterText;
	Tool * tool;
	TextureManager * textureManager;
	MenuManager * menuManager;
	//Border * border;
	//ClosedObject * testObject;
	ObjectList * objectList;
	MaterialList * materialList;
	
	Camera * camera;
	Mouse mouse;
	double lastThoughtTimestamp;
	char * fileName;
	
	void CreateGui();
	void SetCurrentToolText();
	public:
	bool exit;
	
	ToolManager();
	ToolManager(char * filename);
	~ToolManager();
	
	void PrepareFrame();
	void Draw();
	void SetNormalUserInput(unsigned char key,int modifier, bool isDepressed);
	void SetUserInput(int key, int modifier, bool isDepressed);
	void SetUserInput(int key, bool isDepressed, float x, float y);
	void SetPassiveMouse(float x, float y);
	void SetActiveMouse(float x, float y);
	void HandleUserInput();
	void SaveLevel();
	
	Vector2D GetCameraSize();
	
};
#endif /*TOOLMANAGER_H_*/
